class Node:
    def __init__(self,value,next=None):
        self.value = value
        self.next = next

def createLink(n):
    # 先判断
    if n <= 0:
        return False
    elif n == 1:
        return Node(1)
    else:
        head = Node(1)
        p = head
        for i in range(2,n+1):
            p.next = Node(i)
            p = p.next
        p.next = head # 首尾相接
    return head

if __name__ == '__main__':
    n,k,m = map(int,input().split())
    head = createLink(n)
    p = head

    # 从k开始报数，报数到m的人就站出来 从题来看应该是没有异常数据，不用考虑k>n的情况
    ## 先到k的位置
    for i in range(k-1):
        p = p.next

    while p.next != p: # p 不是最后的结点
        for i in range(m-2): # 找到该删除指针的上一个指针
            p = p.next
        print(p.next.value)
        p.next = p.next.next # 连接
        p = p.next # 重新从1开始报数
    print(p.value)

